package com.example.repository;

import com.example.entity.Permission;
import com.example.repository.expand.ExpandJpaRepository;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by wang_hb on 17/3/6.
 */
@Repository
public interface PermissionRepository extends ExpandJpaRepository<Permission,Long> {
    @CacheEvict(value = "permissionCache")
    @Override
    Permission save(Permission permission);

    @Cacheable(value = "permissionCache")
    @Override
    List<Permission> findAll();
}
